﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="valid" uri="http://www.yst.org/tags/valid" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<base href="<%=basePath%>">
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta charset="utf-8">
	<title>银商通支付通信前置系统</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
	<meta name="description" content="银商通支付通信前置系统">
	<meta name="author" content="sheungxin">
	<!-- STYLESHEETS --><!--[if lt IE 9]><script src="js/flot/excanvas.min.js"></script><script src="js/flot/html5.js"></script><script src="js/css3-mediaqueries.js"></script><![endif]-->
	<link rel="stylesheet" type="text/css" href="css/cloud-admin.min.css" >
	<link rel="stylesheet" type="text/css"  href="css/themes/default.min.css" id="skin-switcher" >
	<link rel="stylesheet" type="text/css"  href="css/responsive.min.css" >

	<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet">
	<!-- JQUERY UI-->
	<link rel="stylesheet" type="text/css" href="js/jquery-ui-1.10.3.custom/css/custom-theme/jquery-ui-1.10.3.custom.min.css" />
	<!-- TYPEAHEAD -->
	<link rel="stylesheet" type="text/css" href="js/typeahead/typeahead.css" />
	<!-- SELECT2 -->
	<link rel="stylesheet" type="text/css" href="js/select2/select2.min.css" />
	<!-- UNIFORM -->
	<link rel="stylesheet" type="text/css" href="js/uniform/css/uniform.default.min.css" />
	<!-- WIZARD -->
	<link rel="stylesheet" type="text/css" href="js/bootstrap-wizard/wizard.css" />
</head>
<body  ng-app="interApp" ng-controller="interController">
	<div class="container">
		<div class="row">
			<div id="content" class="col-lg-12">
				<!-- PAGE HEADER-->
				<div class="row">
					<div class="col-sm-12">
						<div class="page-header">
							<!-- STYLER -->

							<!-- /STYLER -->
							<!-- BREADCRUMBS -->
							<ul class="breadcrumb">
								<li>
									<i class="fa fa-th-large"></i>
									<a href="manage/inter/list.jsp" target="user_main_iframe">通道接口管理</a>
									<li>编辑通道接口</li>
								</li>
							</ul>
						</div>
					</div>
				</div>
				<!-- /PAGE HEADER -->

				<!-- EXPORT TABLES -->
				<div class="row">
					<div class="col-md-12">
						<!-- BOX -->
						<div class="box border primary" id="formWizard">
							<div class="box-title">
								<h4><i class="fa fa-bars"></i></h4>
								<div class="tools hidden-xs">
									<a href="javascript:;" class="reload" ng-click="refreshData()">
										<i class="fa fa-refresh"></i>
									</a>
									<a href="javascript:;" class="collapse">
										<i class="fa fa-chevron-up"></i>
									</a>
								</div>
							</div>
							<div class="box-body form">
							<div class="wizard-form">
								   <div class="wizard-content">
									  <ul class="nav nav-pills nav-justified steps">
										 <li>
											<a href="#account" data-toggle="tab" class="wiz-step">
											<span class="step-number">1</span>
											<span class="step-name"><i class="fa fa-check"></i> 接口基础信息 </span>
											</a>
										 </li>
										 <li>
											<a href="#payment" data-toggle="tab" class="wiz-step active">
											<span class="step-number">2</span>
											<span class="step-name"><i class="fa fa-check"></i> 支持银行信息</span>
											</a>
										 </li>
										 <li>
											<a href="#confirm" data-toggle="tab" class="wiz-step">
											<span class="step-number">3</span>
											<span class="step-name"><i class="fa fa-check"></i> 服务器部署信息 </span>
											</a>
										 </li>
										 <li>
											<a href="#attachment" data-toggle="tab" class="wiz-step">
											<span class="step-number">4</span>
											<span class="step-name"><i class="fa fa-check"></i> 附件信息 </span>
											</a>
										 </li>
									  </ul>
									  <div id="bar" class="progress progress-striped progress-sm active" role="progressbar">
										 <div class="progress-bar progress-bar-warning"></div>
									  </div>
									  <div class="tab-content">
									     <div class="alert alert-danger display-none">
											<a class="close" aria-hidden="true" href="#" ></a>
											<p></p>
										 </div>
										 <div class="tab-pane active" id="account">
											<form class="form-horizontal" role="form" id="myForm" name="myForm">
												  <div class="form-group">
											<label class="col-sm-2 control-label" for="name">接口名称</label>
											<div class="col-sm-10">
											  <input type="text" id="name" name="name" class="form-control" ng-model="inter.name" value="{{inter.name}}">
											</div>
										  </div>
										  <div class="form-group">
											<label class="col-sm-2 control-label" for="interfaceType">接口类型</label>
											<div class="col-sm-4">
												<select id="interfaceType" name="interfaceType" ng-model="inter.interfaceType" style="width:100%">
												  	<option></option>
												  	<option value="0" ng-selected="inter.interfaceType == 0">业务接口</option>
												  	<option value="1" ng-selected="inter.interfaceType == 1">外部接口</option>
												  	<option value="2" ng-selected="inter.interfaceType == 2">银行接口</option>
												</select>
											</div>
											<label class="col-sm-2 control-label" for="projectName">项目包名称</label>
											<div class="col-sm-4">
											  <input type="text" id="projectName" name="projectName" class="form-control" ng-model="inter.projectName" value="{{inter.projectName}}">
											</div>
										  </div>
										  <div class="form-group">
											<label class="col-sm-2 control-label" for="channelId">机构</label>
											<div class="col-sm-4">
												<select id="channelId" name="channelId" ng-model="inter.channelId" style="width:100%">
												  	<option></option>
												  	<option ng-if="channel.status==2 || inter.channelId==channel.channelId" ng-repeat="channel in channelList" value="{{channel.channelId}}" ng-selected="inter.channelId==channel.channelId">{{channel.name}}</option>
												</select>
											</div>
											<label class="col-sm-2 control-label" for="businessId">业务分类</label>
											<div class="col-sm-4">
												<select id="businessId" name="businessId" ng-model="inter.businessId" style="width:100%">
												  	<option></option>
												  	<option ng-if="business.status == 2 || inter.businessId==business.businessId" ng-repeat="business in businessList" value="{{business.businessId}}" ng-selected="inter.businessId==business.businessId">{{business.name}}</option>
												</select>
											</div>
										  </div>
										  <div class="form-group">
											<label class="col-sm-2 control-label" for="channelType">业务细类</label>
											<div class="col-sm-4">
												<select id="channelType" name="channelType" ng-model="inter.channelType" style="width:100%">
												  	<option></option>
												  	<option ng-if="ctype.status==1 || inter.channelType==ctype.dictionaryId" ng-repeat="ctype in channelTypeList" value="{{ctype.dictionaryId}}" ng-selected="inter.channelType==ctype.dictionaryId">{{ctype.name}}</option>
												</select>
											</div>
											<label class="col-sm-2 control-label" for="enableStatus">部署状态</label>
											<div class="col-sm-4">
											  <select id="enableStatus" name="enableStatus" ng-model="inter.enableStatus" style="width:100%">
												  	<option></option>
												  	<option value="1" ng-selected="inter.enableStatus==1">未部署</option>
												  	<option value="2" ng-selected="inter.enableStatus==2">已部署</option>
											  </select>
											</div>
										  </div>
										  <div class="form-group">
											<label class="col-sm-2 control-label" for="runStatus">运行状态</label>
											<div class="col-sm-4">
											  	<select id="runStatus" name="runStatus" ng-model="inter.runStatus" style="width:100%">
												  	<option></option>
												  	<option value="0" ng-selected="inter.runStatus==0">测试</option>
												  	<option value="1" ng-selected="inter.runStatus==1">正常</option>
												  	<option value="2" ng-selected="inter.runStatus==2">故障</option>
												  	<option value="3" ng-selected="inter.runStatus==3">停用</option>
												</select>
											</div>
											<label class="col-sm-2 control-label" for="protocol">通讯协议</label>
											<div class="col-sm-4">
											  	<select id="protocol" name="protocol" ng-model="inter.protocol" style="width:100%">
												  	<option></option>
												  	<option ng-if="protocol.status==1 || inter.protocol==protocol.dictionaryId" ng-repeat="protocol in protocolList" value="{{protocol.dictionaryId}}" ng-selected="inter.protocol==protocol.dictionaryId">{{protocol.name}}</option>
												</select>
											</div>
										  </div>
										  <div class="form-group">
											<label class="col-sm-2 control-label" for="packetFormat">报文格式</label>
											<div class="col-sm-4">
											  	<select id="packetFormat" name="packetFormat" ng-model="inter.packetFormat" style="width:100%">
												  	<option></option>
												  	<option ng-if="packetFormat.status==1 || inter.packetFormat==packetFormat.dictionaryId" ng-repeat="packetFormat in packetFormatList" value="{{packetFormat.dictionaryId}}" ng-selected="inter.packetFormat==packetFormat.dictionaryId">{{packetFormat.name}}</option>
												</select>
											</div>
											<label class="col-sm-2 control-label" for="idnteractive">交互方式</label>
											<div class="col-sm-4">
											  	<select id="idnteractive" name="idnteractive" ng-model="inter.idnteractive" style="width:100%">
												  	<option></option>
												  	<option ng-if="idnteractive.status==1 || inter.idnteractive==idnteractive.dictionaryId" ng-repeat="idnteractive in idnteractiveList" value="{{idnteractive.dictionaryId}}" ng-selected="inter.idnteractive==idnteractive.dictionaryId">{{idnteractive.name}}</option>
												</select>
											</div>
										  </div>
										  <div class="form-group">
											<label class="col-sm-2 control-label" for="securitys">安全机制</label>
											<div class="col-sm-10">
											  <textarea id="securitys" name="securitys" class="form-control" ng-model="inter.securitys" rows="3" cols="100%">{{inter.securitys}}</textarea>
											</div>
										  </div>
										  <div class="form-group">
											<label class="col-sm-2 control-label" for="businessNum">商户号</label>
											<div class="col-sm-4">
											  <input type="text" id="businessNum" name="businessNum" class="form-control" ng-model="inter.businessNum" value="{{inter.businessNum}}">
											</div>
											<label class="col-sm-2 control-label" for="businessPwd">商户密码</label>
											<div class="col-sm-4">
											  <input type="text" id="businessPwd" name="businessPwd" class="form-control" ng-model="inter.businessPwd" value="{{inter.businessPwd}}">
											</div>
										  </div>
										  <div class="form-group">
											<label class="col-sm-2 control-label" for="priority">优先级</label>
											<div class="col-sm-10">
											  <input type="text" id="priority" name="priority" class="form-control" ng-model="inter.priority" value="{{inter.priority}}">
											</div>
										  </div>
										  <div class="form-group">
											<label class="col-sm-2 control-label" for="interfaceMsg">接口说明</label>
											<div class="col-sm-10">
											  <textarea id="interfaceMsg" name="interfaceMsg" class="form-control" ng-model="inter.interfaceMsg" rows="3" cols="100%">{{inter.interfaceMsg}}</textarea>
											</div>
										  </div>
										  <div class="form-group">
											<label class="col-sm-2 control-label" for="contacts">联系人</label>
											<div class="col-sm-4">
											  <input type="text" id="contacts" name="contacts" class="form-control" ng-model="inter.contacts" value="{{inter.contacts}}">
											</div>
											<label class="col-sm-2 control-label" for="contactsPhone">联系电话</label>
											<div class="col-sm-4">
											  <input type="text" id="contactsPhone" name="contactsPhone" class="form-control" ng-model="inter.contactsPhone" value="{{inter.contactsPhone}}">
											</div>
										  </div>

											</form>
										 </div>
										 <div class="tab-pane" id="payment">
										 	<form class="form-horizontal" role="form" id="bankForm" name="bankForm">
												<div class="form-group">
													<label class="col-sm-2 control-label" for="contacts">支持银行</label>
													<div class="col-sm-10">
													 	<div class="clearfix">
														 	<select multiple id="bankids" name="bankids" ng-model="inter_sp.bankids" style="width:100%">
															  	<option></option>
															  	<option ng-if="spbank.status==1 || spbank.sel" ng-repeat="spbank in bankList" value="{{spbank.dictionaryId}}" ng-selected="spbank.sel">{{spbank.name}}</option>
															</select>
														</div>
														<div class="separator"></div>
														<div class="panel panel-default" ng-show="inter_sp.bankids.length>0">
														<div class="panel-body">
														  <div class="tabbable tabs-left">
															<ul class="nav nav-tabs" style="width:15%">
															   <li ng-class="{true:'active'}[$index==0]" ng-repeat="spbankid in inter_sp.bankids">
															   	<a href="#tab_{{spbankid}}" data-toggle="tab">{{bankMap[spbankid].name}}</a>
															   </li>
															</ul>
															<div class="tab-content">
															   <div  ng-class="{true:'tab-pane fade in active',false:'tab-pane fade'}[$index==0]" id="tab_{{spbankid}}" ng-repeat="spbankid in inter_sp.bankids">
															   		<div  style="width:82%;float:left;">
															   			<div class="form-group">
																			<label class="col-sm-3 control-label">本地银行代码：</label>
																			<div class="col-sm-3 checkbox-inline">
																			  {{bankMap[spbankid].code}}
																			</div>
																			<label class="col-sm-3 control-label" for="bcode">渠道银行代码：</label>
																			<div class="col-sm-3">
																			  <input type="text" id="{{spbankid}}_bcode" class="form-control">
																			</div>
																		</div>
															   			<div class="panel panel-default">
																		<div class="panel-body">
																			 <div class="tabbable">
																				<ul class="nav nav-tabs">
																				   <li ng-class="{true:'active'}[$index==0]" ng-repeat="zfklx in zfklxList">
																				   	<a href="#tab_{{spbankid}}_{{zfklx.dictionaryId}}" data-toggle="tab">
																				   		<i class="" id="icon_{{spbankid}}_{{zfklx.dictionaryId}}"></i>{{zfklx.name}}
																				   	</a>
																				   </li>
																				</ul>
																				<div class="tab-content">
																				   <div ng-class="{true:'tab-pane fade in active',false:'tab-pane fade'}[$index==0]" id="tab_{{spbankid}}_{{zfklx.dictionaryId}}" ng-repeat="zfklx in zfklxList">
																					  <div class="divide-10"></div>
																					  <div class="form-group">
																						<label class="col-sm-3 control-label">本地{{zfklx.name}}代码：</label>
																						<div class="col-sm-2 checkbox-inline">
																						  {{zfklx.code}}
																						</div>
																						<label class="col-sm-3 control-label" for="zfklx">渠道{{zfklx.name}}代码：</label>
																						<div class="col-sm-4">
																						  <input type="text" id="{{spbankid}}_{{zfklx.dictionaryId}}_zfklx" class="form-control">
																						</div>
																					  </div>
																					  <div class="form-group">
																					   <label class="col-sm-3 control-label">支持{{zfklx.name}}属性：</label>
																						<div class="col-sm-9">
																						  <span ng-repeat="zfksx in zfksxList">
																						  	<label class="checkbox-inline">
																							  <input id="{{spbankid}}-{{zfklx.dictionaryId}}-{{zfksx.dictionaryId}}" type="checkbox" ng-click="selZfksx(spbankid+'-'+zfklx.dictionaryId+'-'+zfksx.dictionaryId);">{{zfksx.name}}
																							</label>
																						  </span>
																						</div>
																					  </div>
																				   </div>
																				</div>
																			 </div>
																		 </div>
																	</div>
															   		</div>
															   </div>
															</div>
														 </div>
													 	 </div>
													 	</div>
													</div>
												</div>
											</form>
										 </div>
										 <div class="tab-pane" id="confirm">
										 	<form class="form-horizontal" role="form" id="serverForm" name="serverForm">
										 	<div class="alert alert-warning ">
											<a class="close" aria-hidden="true" href="#" ></a>
											<p>
												服务器配置信息格式如下所示：<br>
												&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;服务器类型(0:入口服务器,1:实际服务器),IP,端口,访问地址,响应地址,部署目录<br>
												例如：<br>
												&nbsp;&nbsp;&nbsp;&nbsp;0,127.0.0.1,8080,-,-,-<br>
												&nbsp;&nbsp;&nbsp;&nbsp;1,127.0.0.1,8081,-,-,/usr/local/app2/deploy
											</p>
										 </div>

											<div class="form-group">
												<div class="col-sm-12">
													 <textarea id="deployInfo" name="deployInfo" class="form-control" ng-model="deployInfo" placeholder="请输入服务器配置信息" rows="10" cols="100%">{{deployInfo}}</textarea>
												</div>
											</div>
											</form>
										 </div>
										 <!-- attachment information-->
										 <div class="tab-pane" id="attachment">
										 	<!-- SAMPLE BOX CONFIGURATION MODAL FORM-->
											<div class="modal fade" id="box-del" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
												<div class="modal-dialog">
												  <div class="modal-content">
													<div class="modal-header">
													  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
													  <h4 class="modal-title">删除附件</h4>
													</div>
													<div class="modal-body" >
													  	此操作不可逆，确认要删除【<font color="red">{{delItem.mes}}</font>】？
													</div>
													<div class="modal-footer">
													  <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
													  <button type="button" class="btn btn-primary" ng-click="rmAttach(delItem.id)">删除</button>
													</div>
												  </div>
												</div>
											  </div>
											<!-- /SAMPLE BOX CONFIGURATION MODAL FORM-->
										 	<form class="form-horizontal" role="form" id="attachForm" name="attachForm">
										 		<div class="panel panel-default">
											  	<div class="panel-heading">
														<h3 class="panel-title"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">附件信息： </a> </h3>
												 	</div>
											  	<table id="example-dark" class="table table-striped">
												  	<tr ng-repeat="attach in attachmentList" ng-cloak class="ng-cloak">
														 	<td>
													  		&nbsp;&nbsp;&nbsp;&nbsp;{{attach.fileName}}&nbsp;&nbsp;
													  		<a title="单击下载" href="qz/download/filedown?filename={{attach.fileName}}">下载</a>&nbsp;|
													  		<a href="javascript:void(0);" title="删除此文件" class="dropdown-toggle" ng-click="rmAttachTip(attach.chanIntAttId,attach.fileName)">删除</a>
													 		</td>
												  	</tr>
												  	<tr>
												  		<td>
													  		<div class="form-group">
															   	<label class="col-sm-2 control-label" for="businessNum">上传新文件：</label>
															   	<div class="col-sm-4">
																		<input type="file" id="fileid" name="filename" class="input file" file-model="files"/>
																	</div>
																	<div class="col-sm-4">
																		<button type="button" class="btn btn-primary" ng-click="fileupload()">上传</button>
																	</div>
											  				</div>
										  				</td>
												  	</tr>
											  	</table>
										  	</div>
											</form>
										 </div>
										 <!-- end attachment information-->
									  </div>
								   </div>
								   <div class="wizard-buttons">
									  <div class="row">
										 <div class="col-md-12">
											<div class="col-md-offset-3 col-md-9">
											   <a href="javascript:;" class="btn btn-default prevBtn">
												<i class="fa fa-arrow-circle-left"></i> 返回
											   </a>
											   <a href="javascript:;" class="btn btn-primary nextBtn">
												下一步 <i class="fa fa-arrow-circle-right"></i>
											   </a>
											   <a href="javascript:;" class="btn btn-success submitBtn">
												提交 <i class="fa fa-arrow-circle-right"></i>
											   </a>
											</div>
										 </div>
									  </div>
								   </div>
								</div>
							</div>
						</div>
						<!-- /BOX -->
					</div>
				</div>
				<!-- /EXPORT TABLES -->
				<div class="footer-tools">
					<span class="go-top">
						<i class="fa fa-chevron-up"></i> Top
					</span>
				</div>
			</div><!-- /CONTENT-->
		</div>
	</div>
			<script src="js/jquery/jquery-2.0.3.min.js"></script>
	<!-- JQUERY UI-->
	<script src="js/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.min.js"></script>
	<!-- BOOTSTRAP -->
	<script src="bootstrap-dist/js/bootstrap.min.js"></script>
	<script src="js/jquery-validate/jquery.validate.min.js"></script>
	<script src="js/jquery-validate/myvalidate.js"></script>
	<script src="js/jQuery-ajaxfileupload/ajaxfileupload.js"></script>
	<!-- SLIMSCROLL -->
	<script type="text/javascript" src="js/jQuery-slimScroll-1.3.0/jquery.slimscroll.min.js"></script><script type="text/javascript" src="js/jQuery-slimScroll-1.3.0/slimScrollHorizontal.min.js"></script>
	<!-- BLOCK UI -->
	<script type="text/javascript" src="js/jQuery-BlockUI/jquery.blockUI.min.js"></script>
	<!-- COOKIE -->
	<script type="text/javascript" src="js/jQuery-Cookie/jquery.cookie.min.js"></script>
	<!-- TYPEHEAD -->
	<script type="text/javascript" src="js/typeahead/typeahead.min.js"></script>
	<!-- AUTOSIZE -->
	<script type="text/javascript" src="js/autosize/jquery.autosize.min.js"></script>
	<!-- SELECT2 -->
	<script type="text/javascript" src="js/select2/select2.min.js"></script>
	<!-- UNIFORM -->
	<script type="text/javascript" src="js/uniform/jquery.uniform.min.js"></script>
	<!-- WIZARD -->
	<script src="js/bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script>
	<!-- BOOTBOX -->
	<script type="text/javascript" src="js/bootbox/bootbox.min.js"></script>
	<!-- CUSTOM SCRIPT -->
	<script src="js/script.js"></script>
	<script>
		jQuery(document).ready(function() {
		   	App.setPage("wizards_validations");  //Set current page
			App.init(); //Initialise plugins and elements
		});
	</script>
	<script src="js/angular.min.js"></script>
	<script src="js/json2.js"></script>
	<valid:jsValidate modelClass="com.yst.gateway.monitor.models.QzChannelInterface" groupClass="Modify"></valid:jsValidate>
	<script src="js/modules/manage/inter/edit.js"></script>
</body>
</html>